import pygame

import const
from game_object import *


# def draw_all_blocks():
#     global screen
#     for i in range(const.BLOCK_NUMS[0]):
#         for j in range(const.BLOCK_NUMS[1]):
#             x = i * (const.BLOCK_WEIGHT + 1) + 1
#             y = j * (const.BLOCK_WEIGHT + 1) + 1
#             # print((x, y))
#             pygame.draw.rect(screen, (133, 166, 199), (x, y, const.BLOCK_WEIGHT, const.BLOCK_WEIGHT))


# def new_block():
#     global screen
#     for pos in const.BLOCK3:
#         pos_x = (const.BLOCK_WEIGHT + 1) * (pos[0] - 1) + 1
#         pos_y = (const.BLOCK_WEIGHT + 1) * (pos[1] - 1) + 1
#         pygame.draw.rect(screen, const.BLOCK_COLOR, (pos_x, pos_y, const.BLOCK_WEIGHT, const.BLOCK_WEIGHT))


# while True:
#     clock.tick(50)
#     # draw_all_blocks()
#     new_block()
#     pygame.display.update()
#     # sys.exit(0)
#     for event in pygame.event.get():
#         if event.type == pygame.QUIT:
#             sys.exit()


if __name__ == '__main__':
    # 创建游戏对象
    game = TetrisGame()
    # 启动游戏
    game.start_game()
